<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>测试</title>
        <script src="/static/assets/js/jquery.min.js"></script>
        <script src="/static/assets/js/crypto.js">
        </script>
    </head>
    <body>
        <div id="app">默认</div>
        <div id="app2">默认</div>
        <div id="app3">默认</div>
        <div id="app4">默认</div>
        <script type="text/javascript">
            let opu = "hello";
            const kb = CryptoJS.enc.Utf8.parse("d7f389ab0f4e0b21402af32ea3fb8d85"); //32位
            const vb = CryptoJS.enc.Utf8.parse("l7sgZAUxoMzoCzhQ"); //16位
            var encrypted = CryptoJS.AES.encrypt("你好吗aaaaAAAI、、//a\\111、。、|~·", kb, { iv: vb,  mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
            var decrypted = CryptoJS.AES.decrypt('{{ info }}', kb, { iv: vb,  mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
            decrypted = CryptoJS.enc.Utf8.stringify(decrypted);
            $("#app").text('加密：'+ encrypted);
            $("#app2").text('解密：'+decrypted);
            $("#app3").text('加密长度：'+encrypted.toString().length);
            $("#app4").text('解密长度：'+decrypted.length);
            console.log(opu);
            console.log(encrypted.toString());
            console.log(decrypted);
        </script>
    </body>
</html>